﻿@model Home.Site.Models.WebUI.UserViewModel
@{
    ViewBag.Title = ViewBag.Message;
}
@{
    Html.RenderPartial("Account/Gravatar", User.Identity.Name);
}
@if (Model.MusicAlbums.Any() || Model.IsRoot)
{
   
    <h3>Моя музыка:</h3>
     <p>@Html.ActionLink("Добавить музыку", "Create", "Music")</p>
    <p>
        @Html.Partial("MusicBox",Model.MusicAlbums)
    </p>
}
@if (Model.PhotoAlbums.Any() || Model.IsAdmin || Model.IsRoot)
{
    <h3>Мои фотоальбомы:</h3>
    <p>@Html.ActionLink("Добавить альбом", "Create","Album")</p>
    <table class="table table-bordered table-hover table-striped">
        <tr>
            <th>Заголовок</th>
            <th>Дата публикации</th>
            <th>Количество фотографий</th>
            <th>Описание</th>
            <th></th>
        </tr>
        @foreach (var item in Model.PhotoAlbums)
        {
            <tr>
                <td><a href="@Url.Action("Details", "Album", new { id = @item.idalbum })">@item.NameAlbum</a></td>
                <td>@item.DatePublish.ToShortDateString()</td>
                <td>@item.Photos.Count</td>
                <td>@item.Description</td>
                <td>
                    @Html.ActionLink("Ред.", "Edit", "Album", new { id = item.idalbum }, null) |
                    @Html.ActionLink("Детали", "Details", "Album", new { id = item.idalbum }, null) |
                    @Html.ActionLink("Удалить", "Delete", "Album", new { id = item.idalbum }, null)
                </td>
            </tr>
        }
    </table> 
}
@if (Model.Reviews.Any() || Model.IsAdmin || Model.IsRoot || Model.IsOperator)
{
    <h3>Мои обзоры:</h3>
    <p>@Html.ActionLink("Добавить обзор", "Create","Review")</p>
    <table class="table table-bordered table-hover table-striped">
        <tr>
            <th>Заголовок</th>
            <th>Автор</th>
            <th>Дата публикации</th>
            <th>Тип публикации</th>
            <th>Мини контент</th>
            <th></th>
        </tr>
        @foreach (var item in Model.Reviews)
        {
            <tr>
                <td><a href="/review/content/@item.idreview">@item.Title</a></td>
                <td>@item.CreateUser</td>
                <td>@item.DatePublish</td>
                <td>@item.ReviewCategory.name</td>
                <td>@item.MiniContent</td>
                <td>
                    @Html.ActionLink("Ред.", "Edit", "Review", new { id = item.idreview }, null) |
                    @Html.ActionLink("Детали", "Content", "Review", new { id = item.idreview }, null)
                </td>
            </tr>
        }
    </table> 
}
